package net.sk.china.front.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.user.UserToken;

/**
 * UserTokenService 接口
 * +----------------------------------------------------------------------
 * // | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * // +----------------------------------------------------------------------
 * // | Copyright (c) 2018-2024 聊来 All rights reserved.
 * // +----------------------------------------------------------------------
 * // | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * // +----------------------------------------------------------------------
 * // | @Author: 聊来 <18970881148@qq.com>
 * // +----------------------------------------------------------------------
 * // | DateTime: 2024/6/4 16:03
 * // +----------------------------------------------------------------------
 */

public interface UserTokenService extends IService<UserToken> {

    /**
     * 绑定token关系
     * @param openId openid
     * @param type 类型
     * @param userId 用户ID
     */
    void bind(String openId, int type, Integer userId);

    /**
     * 获取UserToken
     * @param token openid
     * @param type 类型
     * @return {@code UserToken}
     */
    UserToken getByOpenidAndType(String token, int type);

    /**
     * 查询用户TOKEN信息
     * @param userId 用户ID
     * @param type 类型
     * @return {@code UserToken}
     */
    UserToken getTokenByUserId(Integer userId, int type);
}
